<?php
if (!function_exists('is_image_file')) {
	function is_image_file ($file) {
		$extension = substr(strrchr($file, '.'), 1);
		$extension = strtolower($extension);
		
		$CI = &get_instance();
		$image_mimes = $CI->config->item('image_mimes');
		
		$result = array_search($extension, $image_mimes);
		
		return !($result === FALSE);
	}
	
}
?>